<template>
  <div>
    <h3>child</h3>
    <button @click="sendNum">将num传递给父元素</button>
  </div>
</template>

<script setup>
const num = ref(100);
// emit  setup(props,{emit})
const emit = defineEmits();
console.log(emit);
const sendNum = () => {
  emit("getNum", num);
};
</script>

<style lang="scss" scoped>
</style>